home *** CD-ROM | disk | FTP | other *** search
/ CD Exchange / CD Exchange - Volume 1.iso / d.t.p / utils / propage / donsgenies / donsgenies.lha / Don'sGenies / ImportBitmap1to1.pprx < prev    next >
Text File  |  1993-05-25  |  1KB  |  56 lines

  1. /* Import bitmap with a scale of 1:1, assuming a screen resolution of 75 dpi in hi-res.
  2. Written by Don Cox  July '92  Not Public Domain. All rights reserved. */
  3.  
  4.  
  5. signal on error
  6. signal on syntax
  7.  
  8. address command
  9. call ppm_AutoUpdate(0)
  10. call SafeEndEdit.rexx()
  11. oldunits = ppm_GetUnits()
  12. call ppm_SetUnits(1)
  13.  
  14. box = ppm_ClickOnBox("Click on destination...")
  15.  
  16. if box=0 then
  17. do
  18. call ppm_Inform(1,"No box selected",)
  19. call ppm_ClearStatus()
  20. exit
  21. end
  22.  
  23. gone = ppm_DeleteContents(box)
  24. filespec = ppm_GetFileName("Select bitmap image file","","")
  25.  
  26.  
  27. worked = ppm_ImportBM(box,filespec)
  28.  
  29. info = ppm_GetBoxInfo(box)
  30. width = word(info,2)
  31. height = word(info,3)
  32. if width>400 then do 
  33.     width = width/75  /* screen images at 75dpi for high res */
  34.     xscale = 1
  35.     end
  36. else do 
  37.     width = width/37.5
  38.     xscale = 2
  39.     end
  40.  
  41.  
  42. if height>360 then do
  43.     height = height/75
  44.     yscale = 1
  45.     end
  46. else do
  47.     height = height/37.5
  48.     yscale = 2
  49.     end
  50.  
  51. call ppm_SetBoxScale(box,xscale,yscale)
  52. call ppm_SetBoxSize(box,width,height)
  53.  
  54. call ppm_SetUnits(oldunits)
  55. call ppm_AutoUpdate(1)
  56. exit